(0) Obligation:

Runtime Complexity TRS:
The TRS R consists of the following rules:

sort#2(Nil) → Nil
sort#2(Cons(x4, x2)) → insert#3(x4, sort#2(x2))
cond_insert_ord_x_ys_1(True, x3, x2, x1) → Cons(x3, Cons(x2, x1))
cond_insert_ord_x_ys_1(False, x3, x2, x1) → Cons(x2, insert#3(x3, x1))
insert#3(x2, Nil) → Cons(x2, Nil)
insert#3(x6, Cons(x4, x2)) → cond_insert_ord_x_ys_1(leq#2(x6, x4), x6, x4, x2)
leq#2(0, x8) → True
leq#2(S(x12), 0) → False
leq#2(S(x4), S(x2)) → leq#2(x4, x2)
main(x1) → sort#2(x1)

Rewrite Strategy: INNERMOST

(1) RenamingProof (EQUIVALENT transformation)

Renamed function symbols to avoid clashes with predefined symbol.

(2) Obligation:

Runtime Complexity Relative TRS:
The TRS R consists of the following rules:

sort#2(Nil) → Nil
sort#2(Cons(x4, x2)) → insert#3(x4, sort#2(x2))
cond_insert_ord_x_ys_1(True, x3, x2, x1) → Cons(x3, Cons(x2, x1))
cond_insert_ord_x_ys_1(False, x3, x2, x1) → Cons(x2, insert#3(x3, x1))
insert#3(x2, Nil) → Cons(x2, Nil)
insert#3(x6, Cons(x4, x2)) → cond_insert_ord_x_ys_1(leq#2(x6, x4), x6, x4, x2)
leq#2(0', x8) → True
leq#2(S(x12), 0') → False
leq#2(S(x4), S(x2)) → leq#2(x4, x2)
main(x1) → sort#2(x1)

S is empty.
Rewrite Strategy: INNERMOST

(3) TypeInferenceProof (BOTH BOUNDS(ID, ID) transformation)

Infered types.

(4) Obligation:

Innermost TRS:
Rules:
sort#2(Nil) → Nil
sort#2(Cons(x4, x2)) → insert#3(x4, sort#2(x2))
cond_insert_ord_x_ys_1(True, x3, x2, x1) → Cons(x3, Cons(x2, x1))
cond_insert_ord_x_ys_1(False, x3, x2, x1) → Cons(x2, insert#3(x3, x1))
insert#3(x2, Nil) → Cons(x2, Nil)
insert#3(x6, Cons(x4, x2)) → cond_insert_ord_x_ys_1(leq#2(x6, x4), x6, x4, x2)
leq#2(0', x8) → True
leq#2(S(x12), 0') → False
leq#2(S(x4), S(x2)) → leq#2(x4, x2)
main(x1) → sort#2(x1)

Types:
sort#2 :: Nil:Cons → Nil:Cons
Nil :: Nil:Cons
Cons :: 0':S → Nil:Cons → Nil:Cons
insert#3 :: 0':S → Nil:Cons → Nil:Cons
cond_insert_ord_x_ys_1 :: True:False → 0':S → 0':S → Nil:Cons → Nil:Cons
True :: True:False
False :: True:False
leq#2 :: 0':S → 0':S → True:False
0' :: 0':S
S :: 0':S → 0':S
main :: Nil:Cons → Nil:Cons
hole_Nil:Cons1_0 :: Nil:Cons
hole_0':S2_0 :: 0':S
hole_True:False3_0 :: True:False
gen_Nil:Cons4_0 :: Nat → Nil:Cons
gen_0':S5_0 :: Nat → 0':S

(5) OrderProof (LOWER BOUND(ID) transformation)

Heuristically decided to analyse the following defined symbols:
sort#2, insert#3, leq#2

They will be analysed ascendingly in the following order:
insert#3 < sort#2
leq#2 < insert#3

(6) Obligation:

Innermost TRS:
Rules:
sort#2(Nil) → Nil
sort#2(Cons(x4, x2)) → insert#3(x4, sort#2(x2))
cond_insert_ord_x_ys_1(True, x3, x2, x1) → Cons(x3, Cons(x2, x1))
cond_insert_ord_x_ys_1(False, x3, x2, x1) → Cons(x2, insert#3(x3, x1))
insert#3(x2, Nil) → Cons(x2, Nil)
insert#3(x6, Cons(x4, x2)) → cond_insert_ord_x_ys_1(leq#2(x6, x4), x6, x4, x2)
leq#2(0', x8) → True
leq#2(S(x12), 0') → False
leq#2(S(x4), S(x2)) → leq#2(x4, x2)
main(x1) → sort#2(x1)

Types:
sort#2 :: Nil:Cons → Nil:Cons
Nil :: Nil:Cons
Cons :: 0':S → Nil:Cons → Nil:Cons
insert#3 :: 0':S → Nil:Cons → Nil:Cons
cond_insert_ord_x_ys_1 :: True:False → 0':S → 0':S → Nil:Cons → Nil:Cons
True :: True:False
False :: True:False
leq#2 :: 0':S → 0':S → True:False
0' :: 0':S
S :: 0':S → 0':S
main :: Nil:Cons → Nil:Cons
hole_Nil:Cons1_0 :: Nil:Cons
hole_0':S2_0 :: 0':S
hole_True:False3_0 :: True:False
gen_Nil:Cons4_0 :: Nat → Nil:Cons
gen_0':S5_0 :: Nat → 0':S

Generator Equations:
gen_Nil:Cons4_0(0) ⇔ Nil
gen_Nil:Cons4_0(+(x, 1)) ⇔ Cons(0', gen_Nil:Cons4_0(x))
gen_0':S5_0(0) ⇔ 0'
gen_0':S5_0(+(x, 1)) ⇔ S(gen_0':S5_0(x))

The following defined symbols remain to be analysed:
leq#2, sort#2, insert#3

They will be analysed ascendingly in the following order:
insert#3 < sort#2
leq#2 < insert#3

(7) RewriteLemmaProof (LOWER BOUND(ID) transformation)

Proved the following rewrite lemma:
leq#2(gen_0':S5_0(n7_0), gen_0':S5_0(n7_0)) → True, rt ∈ Ω(1 + n70)

Induction Base:
leq#2(gen_0':S5_0(0), gen_0':S5_0(0)) →RΩ(1)
True

Induction Step:
leq#2(gen_0':S5_0(+(n7_0, 1)), gen_0':S5_0(+(n7_0, 1))) →RΩ(1)
leq#2(gen_0':S5_0(n7_0), gen_0':S5_0(n7_0)) →IH
True

We have rt ∈ Ω(n1) and sz ∈ O(n). Thus, we have ircR ∈ Ω(n).

(8) Complex Obligation (BEST)

(9) Obligation:

Innermost TRS:
Rules:
sort#2(Nil) → Nil
sort#2(Cons(x4, x2)) → insert#3(x4, sort#2(x2))
cond_insert_ord_x_ys_1(True, x3, x2, x1) → Cons(x3, Cons(x2, x1))
cond_insert_ord_x_ys_1(False, x3, x2, x1) → Cons(x2, insert#3(x3, x1))
insert#3(x2, Nil) → Cons(x2, Nil)
insert#3(x6, Cons(x4, x2)) → cond_insert_ord_x_ys_1(leq#2(x6, x4), x6, x4, x2)
leq#2(0', x8) → True
leq#2(S(x12), 0') → False
leq#2(S(x4), S(x2)) → leq#2(x4, x2)
main(x1) → sort#2(x1)

Types:
sort#2 :: Nil:Cons → Nil:Cons
Nil :: Nil:Cons
Cons :: 0':S → Nil:Cons → Nil:Cons
insert#3 :: 0':S → Nil:Cons → Nil:Cons
cond_insert_ord_x_ys_1 :: True:False → 0':S → 0':S → Nil:Cons → Nil:Cons
True :: True:False
False :: True:False
leq#2 :: 0':S → 0':S → True:False
0' :: 0':S
S :: 0':S → 0':S
main :: Nil:Cons → Nil:Cons
hole_Nil:Cons1_0 :: Nil:Cons
hole_0':S2_0 :: 0':S
hole_True:False3_0 :: True:False
gen_Nil:Cons4_0 :: Nat → Nil:Cons
gen_0':S5_0 :: Nat → 0':S

Lemmas:
leq#2(gen_0':S5_0(n7_0), gen_0':S5_0(n7_0)) → True, rt ∈ Ω(1 + n70)

Generator Equations:
gen_Nil:Cons4_0(0) ⇔ Nil
gen_Nil:Cons4_0(+(x, 1)) ⇔ Cons(0', gen_Nil:Cons4_0(x))
gen_0':S5_0(0) ⇔ 0'
gen_0':S5_0(+(x, 1)) ⇔ S(gen_0':S5_0(x))

The following defined symbols remain to be analysed:
insert#3, sort#2

They will be analysed ascendingly in the following order:
insert#3 < sort#2

(10) NoRewriteLemmaProof (LOWER BOUND(ID) transformation)

Could not prove a rewrite lemma for the defined symbol insert#3.

(11) Obligation:

Innermost TRS:
Rules:
sort#2(Nil) → Nil
sort#2(Cons(x4, x2)) → insert#3(x4, sort#2(x2))
cond_insert_ord_x_ys_1(True, x3, x2, x1) → Cons(x3, Cons(x2, x1))
cond_insert_ord_x_ys_1(False, x3, x2, x1) → Cons(x2, insert#3(x3, x1))
insert#3(x2, Nil) → Cons(x2, Nil)
insert#3(x6, Cons(x4, x2)) → cond_insert_ord_x_ys_1(leq#2(x6, x4), x6, x4, x2)
leq#2(0', x8) → True
leq#2(S(x12), 0') → False
leq#2(S(x4), S(x2)) → leq#2(x4, x2)
main(x1) → sort#2(x1)

Types:
sort#2 :: Nil:Cons → Nil:Cons
Nil :: Nil:Cons
Cons :: 0':S → Nil:Cons → Nil:Cons
insert#3 :: 0':S → Nil:Cons → Nil:Cons
cond_insert_ord_x_ys_1 :: True:False → 0':S → 0':S → Nil:Cons → Nil:Cons
True :: True:False
False :: True:False
leq#2 :: 0':S → 0':S → True:False
0' :: 0':S
S :: 0':S → 0':S
main :: Nil:Cons → Nil:Cons
hole_Nil:Cons1_0 :: Nil:Cons
hole_0':S2_0 :: 0':S
hole_True:False3_0 :: True:False
gen_Nil:Cons4_0 :: Nat → Nil:Cons
gen_0':S5_0 :: Nat → 0':S

Lemmas:
leq#2(gen_0':S5_0(n7_0), gen_0':S5_0(n7_0)) → True, rt ∈ Ω(1 + n70)

Generator Equations:
gen_Nil:Cons4_0(0) ⇔ Nil
gen_Nil:Cons4_0(+(x, 1)) ⇔ Cons(0', gen_Nil:Cons4_0(x))
gen_0':S5_0(0) ⇔ 0'
gen_0':S5_0(+(x, 1)) ⇔ S(gen_0':S5_0(x))

The following defined symbols remain to be analysed:
sort#2

(12) RewriteLemmaProof (LOWER BOUND(ID) transformation)

Proved the following rewrite lemma:
sort#2(gen_Nil:Cons4_0(n454_0)) → *6_0, rt ∈ Ω(n4540)

Induction Base:
sort#2(gen_Nil:Cons4_0(0))

Induction Step:
sort#2(gen_Nil:Cons4_0(+(n454_0, 1))) →RΩ(1)
insert#3(0', sort#2(gen_Nil:Cons4_0(n454_0))) →IH
insert#3(0', *6_0)

We have rt ∈ Ω(n1) and sz ∈ O(n). Thus, we have ircR ∈ Ω(n).

(13) Complex Obligation (BEST)

(14) Obligation:

Innermost TRS:
Rules:
sort#2(Nil) → Nil
sort#2(Cons(x4, x2)) → insert#3(x4, sort#2(x2))
cond_insert_ord_x_ys_1(True, x3, x2, x1) → Cons(x3, Cons(x2, x1))
cond_insert_ord_x_ys_1(False, x3, x2, x1) → Cons(x2, insert#3(x3, x1))
insert#3(x2, Nil) → Cons(x2, Nil)
insert#3(x6, Cons(x4, x2)) → cond_insert_ord_x_ys_1(leq#2(x6, x4), x6, x4, x2)
leq#2(0', x8) → True
leq#2(S(x12), 0') → False
leq#2(S(x4), S(x2)) → leq#2(x4, x2)
main(x1) → sort#2(x1)

Types:
sort#2 :: Nil:Cons → Nil:Cons
Nil :: Nil:Cons
Cons :: 0':S → Nil:Cons → Nil:Cons
insert#3 :: 0':S → Nil:Cons → Nil:Cons
cond_insert_ord_x_ys_1 :: True:False → 0':S → 0':S → Nil:Cons → Nil:Cons
True :: True:False
False :: True:False
leq#2 :: 0':S → 0':S → True:False
0' :: 0':S
S :: 0':S → 0':S
main :: Nil:Cons → Nil:Cons
hole_Nil:Cons1_0 :: Nil:Cons
hole_0':S2_0 :: 0':S
hole_True:False3_0 :: True:False
gen_Nil:Cons4_0 :: Nat → Nil:Cons
gen_0':S5_0 :: Nat → 0':S

Lemmas:
leq#2(gen_0':S5_0(n7_0), gen_0':S5_0(n7_0)) → True, rt ∈ Ω(1 + n70)
sort#2(gen_Nil:Cons4_0(n454_0)) → *6_0, rt ∈ Ω(n4540)

Generator Equations:
gen_Nil:Cons4_0(0) ⇔ Nil
gen_Nil:Cons4_0(+(x, 1)) ⇔ Cons(0', gen_Nil:Cons4_0(x))
gen_0':S5_0(0) ⇔ 0'
gen_0':S5_0(+(x, 1)) ⇔ S(gen_0':S5_0(x))

No more defined symbols left to analyse.

(15) LowerBoundsProof (EQUIVALENT transformation)

The lowerbound Ω(n1) was proven with the following lemma:
leq#2(gen_0':S5_0(n7_0), gen_0':S5_0(n7_0)) → True, rt ∈ Ω(1 + n70)

(16) BOUNDS(n^1, INF)

(17) Obligation:

Innermost TRS:
Rules:
sort#2(Nil) → Nil
sort#2(Cons(x4, x2)) → insert#3(x4, sort#2(x2))
cond_insert_ord_x_ys_1(True, x3, x2, x1) → Cons(x3, Cons(x2, x1))
cond_insert_ord_x_ys_1(False, x3, x2, x1) → Cons(x2, insert#3(x3, x1))
insert#3(x2, Nil) → Cons(x2, Nil)
insert#3(x6, Cons(x4, x2)) → cond_insert_ord_x_ys_1(leq#2(x6, x4), x6, x4, x2)
leq#2(0', x8) → True
leq#2(S(x12), 0') → False
leq#2(S(x4), S(x2)) → leq#2(x4, x2)
main(x1) → sort#2(x1)

Types:
sort#2 :: Nil:Cons → Nil:Cons
Nil :: Nil:Cons
Cons :: 0':S → Nil:Cons → Nil:Cons
insert#3 :: 0':S → Nil:Cons → Nil:Cons
cond_insert_ord_x_ys_1 :: True:False → 0':S → 0':S → Nil:Cons → Nil:Cons
True :: True:False
False :: True:False
leq#2 :: 0':S → 0':S → True:False
0' :: 0':S
S :: 0':S → 0':S
main :: Nil:Cons → Nil:Cons
hole_Nil:Cons1_0 :: Nil:Cons
hole_0':S2_0 :: 0':S
hole_True:False3_0 :: True:False
gen_Nil:Cons4_0 :: Nat → Nil:Cons
gen_0':S5_0 :: Nat → 0':S

Lemmas:
leq#2(gen_0':S5_0(n7_0), gen_0':S5_0(n7_0)) → True, rt ∈ Ω(1 + n70)
sort#2(gen_Nil:Cons4_0(n454_0)) → *6_0, rt ∈ Ω(n4540)

Generator Equations:
gen_Nil:Cons4_0(0) ⇔ Nil
gen_Nil:Cons4_0(+(x, 1)) ⇔ Cons(0', gen_Nil:Cons4_0(x))
gen_0':S5_0(0) ⇔ 0'
gen_0':S5_0(+(x, 1)) ⇔ S(gen_0':S5_0(x))

No more defined symbols left to analyse.

(18) LowerBoundsProof (EQUIVALENT transformation)

The lowerbound Ω(n1) was proven with the following lemma:
leq#2(gen_0':S5_0(n7_0), gen_0':S5_0(n7_0)) → True, rt ∈ Ω(1 + n70)

(19) BOUNDS(n^1, INF)

(20) Obligation:

Innermost TRS:
Rules:
sort#2(Nil) → Nil
sort#2(Cons(x4, x2)) → insert#3(x4, sort#2(x2))
cond_insert_ord_x_ys_1(True, x3, x2, x1) → Cons(x3, Cons(x2, x1))
cond_insert_ord_x_ys_1(False, x3, x2, x1) → Cons(x2, insert#3(x3, x1))
insert#3(x2, Nil) → Cons(x2, Nil)
insert#3(x6, Cons(x4, x2)) → cond_insert_ord_x_ys_1(leq#2(x6, x4), x6, x4, x2)
leq#2(0', x8) → True
leq#2(S(x12), 0') → False
leq#2(S(x4), S(x2)) → leq#2(x4, x2)
main(x1) → sort#2(x1)

Types:
sort#2 :: Nil:Cons → Nil:Cons
Nil :: Nil:Cons
Cons :: 0':S → Nil:Cons → Nil:Cons
insert#3 :: 0':S → Nil:Cons → Nil:Cons
cond_insert_ord_x_ys_1 :: True:False → 0':S → 0':S → Nil:Cons → Nil:Cons
True :: True:False
False :: True:False
leq#2 :: 0':S → 0':S → True:False
0' :: 0':S
S :: 0':S → 0':S
main :: Nil:Cons → Nil:Cons
hole_Nil:Cons1_0 :: Nil:Cons
hole_0':S2_0 :: 0':S
hole_True:False3_0 :: True:False
gen_Nil:Cons4_0 :: Nat → Nil:Cons
gen_0':S5_0 :: Nat → 0':S

Lemmas:
leq#2(gen_0':S5_0(n7_0), gen_0':S5_0(n7_0)) → True, rt ∈ Ω(1 + n70)

Generator Equations:
gen_Nil:Cons4_0(0) ⇔ Nil
gen_Nil:Cons4_0(+(x, 1)) ⇔ Cons(0', gen_Nil:Cons4_0(x))
gen_0':S5_0(0) ⇔ 0'
gen_0':S5_0(+(x, 1)) ⇔ S(gen_0':S5_0(x))

No more defined symbols left to analyse.

(21) LowerBoundsProof (EQUIVALENT transformation)

The lowerbound Ω(n1) was proven with the following lemma:
leq#2(gen_0':S5_0(n7_0), gen_0':S5_0(n7_0)) → True, rt ∈ Ω(1 + n70)

(22) BOUNDS(n^1, INF)